package com.technique.api.dao.mapper;

import com.technique.api.dao.entity.PlaceRegister;
import com.technique.api.dao.entity.PlaceRegisterExample;
import com.technique.api.dao.entity.PlaceRegisterKey;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;

public interface PlaceRegisterMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table place_register
     *
     * @mbggenerated
     */
    @SelectProvider(type=PlaceRegisterSqlProvider.class, method="countByExample")
    int countByExample(PlaceRegisterExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table place_register
     *
     * @mbggenerated
     */
    @DeleteProvider(type=PlaceRegisterSqlProvider.class, method="deleteByExample")
    int deleteByExample(PlaceRegisterExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table place_register
     *
     * @mbggenerated
     */
    @Delete({
        "delete from place_register",
        "where place_id = #{placeId,jdbcType=BIGINT}",
          "and user_id = #{userId,jdbcType=BIGINT}"
    })
    int deleteByPrimaryKey(PlaceRegisterKey key);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table place_register
     *
     * @mbggenerated
     */
    @Insert({
        "insert into place_register (place_id, user_id, ",
        "register_date, state)",
        "values (#{placeId,jdbcType=BIGINT}, #{userId,jdbcType=BIGINT}, ",
        "#{registerDate,jdbcType=TIMESTAMP}, #{state,jdbcType=SMALLINT})"
    })
    int insert(PlaceRegister record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table place_register
     *
     * @mbggenerated
     */
    @InsertProvider(type=PlaceRegisterSqlProvider.class, method="insertSelective")
    int insertSelective(PlaceRegister record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table place_register
     *
     * @mbggenerated
     */
    @SelectProvider(type=PlaceRegisterSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="place_id", property="placeId", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="user_id", property="userId", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="register_date", property="registerDate", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="state", property="state", jdbcType=JdbcType.SMALLINT)
    })
    List<PlaceRegister> selectByExample(PlaceRegisterExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table place_register
     *
     * @mbggenerated
     */
    @Select({
        "select",
        "place_id, user_id, register_date, state",
        "from place_register",
        "where place_id = #{placeId,jdbcType=BIGINT}",
          "and user_id = #{userId,jdbcType=BIGINT}"
    })
    @Results({
        @Result(column="place_id", property="placeId", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="user_id", property="userId", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="register_date", property="registerDate", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="state", property="state", jdbcType=JdbcType.SMALLINT)
    })
    PlaceRegister selectByPrimaryKey(PlaceRegisterKey key);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table place_register
     *
     * @mbggenerated
     */
    @UpdateProvider(type=PlaceRegisterSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") PlaceRegister record, @Param("example") PlaceRegisterExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table place_register
     *
     * @mbggenerated
     */
    @UpdateProvider(type=PlaceRegisterSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") PlaceRegister record, @Param("example") PlaceRegisterExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table place_register
     *
     * @mbggenerated
     */
    @UpdateProvider(type=PlaceRegisterSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(PlaceRegister record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table place_register
     *
     * @mbggenerated
     */
    @Update({
        "update place_register",
        "set register_date = #{registerDate,jdbcType=TIMESTAMP},",
          "state = #{state,jdbcType=SMALLINT}",
        "where place_id = #{placeId,jdbcType=BIGINT}",
          "and user_id = #{userId,jdbcType=BIGINT}"
    })
    int updateByPrimaryKey(PlaceRegister record);
}